/**************************************************
 * Filename: ConnectionParameter.java
 * Version: v1.0
 * CreatedDate: 2011-5-5
 * Copyright (C) 2011 By cafebabe.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see http://www.gnu.org/licenses/.
 *
 * If you would like to negotiate alternate licensing terms, you may do
 * so by contacting the author: talentyao@foxmail.com
 ***************************************************/

package com.ywh.dbpools;

/**
 * 功能描述
 * 
 * @author cafebabe
 * @since 2011-5-5
 * @version 1.0
 */
public class ConnectionParameter {
	private String name;
	private String driver; // 数据库驱动程序
	private String url; // 数据连接的URL
	private String user; // 数据库用户名
	private String password; // 数据库密码
	private int minConnection = 0; // 初始化连接数
	private int maxConnection = 50; // 最大连接数
	private long timeoutValue = 600000; // 连接的最大空闲时间
	private int waitTime = 30000; // 取连接的时候如果没有可用连接最大的等待时间

	public String getDriver() {
		return driver;
	}

	public int getMaxConnection() {
		return maxConnection;
	}

	public int getMinConnection() {
		return minConnection;
	}

	public String getPassword() {
		return password;
	}

	public long getTimeoutValue() {
		return timeoutValue;
	}

	public String getUrl() {
		return url;
	}

	public String getUser() {
		return user;
	}

	public int getWaitTime() {
		return waitTime;
	}

	public void setDriver(String driver) {
		this.driver = driver;
	}

	public void setMaxConnection(int maxConnection) {
		this.maxConnection = maxConnection;
	}

	public void setMinConnection(int minConnection) {
		this.minConnection = minConnection < 0 ? 0 : minConnection;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public void setTimeoutValue(long timeoutValue) {
		this.timeoutValue = timeoutValue;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public void setUser(String user) {
		this.user = user;
	}

	public void setWaitTime(int waitTime) {
		this.waitTime = waitTime;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
